/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.octgame.octantis;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.octgame.octantis.flight.FlightState;
import org.octgame.octantis.mainmenu.MainMenuState;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.octgame.resources.twl.TWLStateBasedGame;

/**
 *
 * @author Henrik Bergvin <henrik.bergvin@gmail.com>
 */
public class OctGame extends TWLStateBasedGame {

    public static final int INITIALIZESTATE = 0;
    public static final int MENUSTATE       = 1;
    public static final int DEPARTSTATE     = 2;

    public static final int FLIGHTSTATE     = 99;

    public static final String THEMENAME = "state0";

    public OctGame()
    {
        super("Octantis Prime");
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws SlickException {
        AppGameContainer app = new AppGameContainer(new OctGame());
        app.setDisplayMode(800, 600, false);
        app.start();
    }

    @Override
    public void initStatesList(GameContainer gc) throws SlickException {
        this.addState(new MainMenuState(MENUSTATE));
        this.addState(new FlightState(FLIGHTSTATE));
        this.addState(new InitializeState(INITIALIZESTATE));
        this.enterState(FLIGHTSTATE);
    }

    @Override
    protected URL getThemeURL() {
        
        try {
            File file = new File("resources/ui/simple.xml");
            return file.toURI().toURL();
            //return Octantis.class.getResource("resources/ui/simple.xml");
        } catch (MalformedURLException ex) {
            Logger.getLogger(OctGame.class.getName()).log(Level.SEVERE, null, ex);
        }

        return null;

    }


}
